package com.baozou.framework.util;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class DateUtil {

	public static String getToday(){
		Date day = new Date();
		SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd");
		return f.format(day);
	}
	
	public static String getDay(Date date, int add){
		Calendar c = Calendar.getInstance();
		c.setTime(date);
		c.add(Calendar.DAY_OF_MONTH, add);
		SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd");
		return f.format(c.getTime());
	}
	
	public static String formatDate(Date date, String format){
		SimpleDateFormat f = new SimpleDateFormat(format);
		return f.format(date);
	}
}
